package com.moon.utils;

import com.moon.pojo.LoginInfo;

public class CurrentUserContextHolder {
    private static final ThreadLocal<LoginInfo> currentUserHolder = new ThreadLocal<>();

    public static void set(LoginInfo loginInfo) {
        currentUserHolder.set(loginInfo);
    }

    public static LoginInfo get() {
        return currentUserHolder.get();
    }

    public static void clear() {
        currentUserHolder.remove();
    }
}